function classification_data = class_train(X, Y)
% Initialize model parameters
w = zeros(size(X, 1), 1);  % Initialize weight vector
b = 0;  % Initialize bias

% Set learning rate and number of iterations
learning_rate = 0.01;
num_iterations = 1000;

% Train the model
for iteration = 1:num_iterations
    % Iterate over training samples
    for i = 1:size(X, 2)
        % Calculate predicted value
        y_pred = dot(w, X(:, i)) + b;

        % Update weights and bias
        if (Y(i) * y_pred) <= 0
            w = w + learning_rate * (Y(i) * X(:, i));
            b = b + learning_rate * Y(i);
        end
    end
end

% Output results
disp('Weight vector w:');
disp(w);
disp('Bias b:');
disp(b);

classification_data.w = w;
classification_data.b = b;
end